{if $full_page}
{include file="pageheader.htm"}
{insert_scripts files="../js/utils.js,listtable.js"}
<!-- 订单搜索 -->
<div class="form-div" style="display:none;">
  <form action="javascript:searchOrder()" name="searchForm">
    <img src="images/icon_search.gif" width="26" height="22" border="0" alt="SEARCH" />
    {$lang.label_delivery_sn}<input name="delivery_sn" type="text" id="delivery_sn" size="15">
    {$lang.order_sn}<input name="order_sn" type="text" id="order_sn" size="15">
    {$lang.consignee|escape}<input name="consignee" type="text" id="consignee" size="15">
    <input type="submit" value="{$lang.button_search}" class="button" />
  </form>
</div>

<!-- 订单列表 -->
<form method="post" action="order.php?act=operate" name="listForm" onsubmit="return check()">
  <div class="list-div" id="listDiv">
{/if}

<table cellpadding="3" cellspacing="1">
  <tr>
    <th>
      <!-- <input onclick='listTable.selectAll(this, "back_id")' type="checkbox"/> -->
	  <!-- <a href="javascript:listTable.sort('delivery_sn', 'DESC'); "> -->
	  <!-- {$lang.label_delivery_sn}</a> -->
	  发货单流水号
    </th>
    <th>订单号</th>
    <th>申请人</th>
    <th>申请时间</th>
    <th>退货数量</th>
    <th>实际退货总金额</th>
    <th>退货销售单价</th>
    <th>退货销售金额</th>
    <th>采购单价</th>
    <th>采购总金额</th>
    <th>退货完成时间</th>
    <th>退货商品供应商</th>
  <tr>
  {foreach from=$back_list item=back key=dkey}
  <tr>
    <td valign="top" nowrap="nowrap">
	<!-- <input type="checkbox" name="back_id[]" value="{$back.back_id}" /> -->
	{$back.delivery_sn}
	</td>
    <td>{$back.order_sn}<br /></td>
	<td>{$back.user_name}</td>
    <td align="center" valign="top" nowrap="nowrap">{$back.add_time}</td>
	<td align="center" valign="top" nowrap="nowrap">{$back.goods_nums}</td>
	<td align="center" valign="top" nowrap="nowrap">{$back.back_amount}</td>
	<td align="center" valign="top" nowrap="nowrap">{$back.goods_price}</td>
	<td align="center" valign="top" nowrap="nowrap">{$back.goods_amount}</td>
	
	<td align="center" valign="top" nowrap="nowrap">0.00</td>
	<td align="center" valign="top" nowrap="nowrap">0.00</td>
    <td align="center" valign="top" nowrap="nowrap">{$back.return_time}</td>
    <td align="center" valign="top" nowrap="nowrap">退货供应商</td>
	
  </tr>
  {/foreach}
</table>

<!-- 分页 -->
<table id="page-table" cellspacing="0">
  <tr>
    <td align="left" nowrap="true">
   <a href="export.php?act=refund_goods" target="_Blank" style="padding: 2px 8px 2px;margin: 2px 2px;color: #fff;font-size: 12px;border: none;border-radius: 3px;background: #c43926;text-decoration: none;">导出退货单</a>
    </td>
    <td align="right" nowrap="true">
    {include file="page.htm"}
    </td>
  </tr>
</table>

{if $full_page}
  </div>

</form>
<script language="JavaScript">
listTable.recordCount = {$record_count};
listTable.pageCount = {$page_count};

{foreach from=$filter item=item key=key}
listTable.filter.{$key} = '{$item}';
{/foreach}
{literal}

    onload = function()
    {
        // 开始检查订单
        startCheckOrder();
                
        //
        listTable.query = "back_query";
    }

    /**
     * 搜索订单
     */
    function searchOrder()
    {
        listTable.filter['order_sn'] = Utils.trim(document.forms['searchForm'].elements['order_sn'].value);
        listTable.filter['consignee'] = Utils.trim(document.forms['searchForm'].elements['consignee'].value);
        listTable.filter['delivery_sn'] = document.forms['searchForm'].elements['delivery_sn'].value;
        listTable.filter['page'] = 1;
        listTable.query = "back_query";
        listTable.loadList();
    }

    function check()
    {
      var snArray = new Array();
      var eles = document.forms['listForm'].elements;
      for (var i=0; i<eles.length; i++)
      {
        if (eles[i].tagName == 'INPUT' && eles[i].type == 'checkbox' && eles[i].checked && eles[i].value != 'on')
        {
          snArray.push(eles[i].value);
        }
      }
      if (snArray.length == 0)
      {
        return false;
      }
      else
      {
        eles['order_id'].value = snArray.toString();
        return true;
      }
    }
</script>
{/literal}

{include file="pagefooter.htm"}
{/if}